<!-- saved from url=(0014)about:internet -->
<html>
<body>
<script src="resources/eml_report_loadable_data.js"></script>
<div class="dead">
<pre class="code">
<span class="srcline"><span class="lineno"><a href="3,1" id="srcline1"> 1</a></span><span class="line"><span class="keyword">classdef</span> <span class="mxinfo " id="T15:U1">ros_rate</span> &lt; matlab.System</span></span>
<span class="srcline"><span class="lineno"><a href="3,2" id="srcline2"> 2</a></span><span class="line">   </span></span>
<span class="srcline"><span class="lineno"><a href="3,3" id="srcline3"> 3</a></span><span class="line">    <span class="comment">% Public, tunable properties</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,4" id="srcline4"> 4</a></span><span class="line">    <span class="keyword">properties</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,5" id="srcline5"> 5</a></span><span class="line">        RATE;</span></span>
<span class="srcline"><span class="lineno"><a href="3,6" id="srcline6"> 6</a></span><span class="line">        </span></span>
<span class="srcline"><span class="lineno"><a href="3,7" id="srcline7"> 7</a></span><span class="line">    <span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,8" id="srcline8"> 8</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="3,9" id="srcline9"> 9</a></span><span class="line">    <span class="keyword">properties</span>(DiscreteState)</span></span>
<span class="srcline"><span class="lineno"><a href="3,10" id="srcline10">10</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="3,11" id="srcline11">11</a></span><span class="line">    <span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,12" id="srcline12">12</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="3,13" id="srcline13">13</a></span><span class="line">    <span class="comment">% Pre-computed constants</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,14" id="srcline14">14</a></span><span class="line">    <span class="keyword">properties</span>(Access = private)</span></span>
<span class="srcline"><span class="lineno"><a href="3,15" id="srcline15">15</a></span><span class="line">        rateObj;</span></span>
<span class="srcline"><span class="lineno"><a href="3,16" id="srcline16">16</a></span><span class="line">    <span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,17" id="srcline17">17</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="3,18" id="srcline18">18</a></span><span class="line">    <span class="keyword">methods</span>(Access = protected)</span></span>
</pre>
</div>
<pre class="code">
<span class="srcline"><span class="lineno"><a href="3,19" id="srcline19">19</a></span><span class="line">        <span class="keyword">function</span> setupImpl(<span class="var type0" id="S6T0U29">obj</span>)</span></span>
<span class="srcline"><span class="lineno"><a href="3,20" id="srcline20">20</a></span><span class="line">            <span class="comment">% Perform one-time calculations, such as computing constants</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,21" id="srcline21">21</a></span><span class="line">            <span class="comment">%obj.RateObj = robotics.Rate(1/obj.SampleTime);</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,22" id="srcline22">22</a></span><span class="line">            <span class="var type0" id="S6T0U33">obj</span>.rateObj = robotics.Rate(<span class="var type0" id="S6T0U40">obj</span>.RATE);</span></span>
<span class="srcline"><span class="lineno"><a href="3,23" id="srcline23">23</a></span><span class="line">        <span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,24" id="srcline24">24</a></span><span class="line"></span></span>
</pre>
<div class="dead">
<pre class="code">
<span class="srcline"><span class="lineno"><a href="3,25" id="srcline25">25</a></span><span class="line">        <span class="keyword">function</span> stepImpl(obj)</span></span>
<span class="srcline"><span class="lineno"><a href="3,26" id="srcline26">26</a></span><span class="line">            <span class="comment">% Implement algorithm. Calculate y as a function of input u and</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,27" id="srcline27">27</a></span><span class="line">            <span class="comment">% discrete states.</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,28" id="srcline28">28</a></span><span class="line">            obj.RateObj.waitfor();</span></span>
<span class="srcline"><span class="lineno"><a href="3,29" id="srcline29">29</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="3,30" id="srcline30">30</a></span><span class="line">        <span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,31" id="srcline31">31</a></span><span class="line"></span></span>
<span class="srcline"><span class="lineno"><a href="3,32" id="srcline32">32</a></span><span class="line">        <span class="keyword">function</span> resetImpl(obj)</span></span>
<span class="srcline"><span class="lineno"><a href="3,33" id="srcline33">33</a></span><span class="line">            <span class="comment">% Initialize / reset discrete-state properties</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,34" id="srcline34">34</a></span><span class="line">        <span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,35" id="srcline35">35</a></span><span class="line">    <span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,36" id="srcline36">36</a></span><span class="line"><span class="keyword">end</span></span></span>
<span class="srcline"><span class="lineno"><a href="3,37" id="srcline37">37</a></span><span class="line"> </span></span>
</pre>
</div>
</body>
</html>
